chore: remove redundant @Repository annotations and upgrade Spring Boot to 4.1.0 - #6930
chore: remove redundant @Repository annotations and upgrade Spring Boot to 4.1.0#6930Ludy87 wants to merge 19 commits into
@Repository annotations and upgrade Spring Boot to 4.1.0#6930Conversation
| + " p.teamId = :teamId) order by coalesce(p.sortOrder, 0) asc, p.id asc") | ||
| List<PolicyEntity> findByTeam(@Param("teamId") Long teamId); | ||
|
|
||
| /** All policies in run order — used when team scoping is off (login-disabled). */ | ||
| @Query("select p from PolicyEntity p order by coalesce(p.sortOrder, 0) asc, p.id asc") |
There was a problem hiding this comment.
Query logic conflicts with its documented behavior: coalesce(p.sortOrder, 0) makes null and 0 equivalent, so null sortOrder rows are not guaranteed to sort first.
Show fix
| + " p.teamId = :teamId) order by coalesce(p.sortOrder, 0) asc, p.id asc") | |
| List<PolicyEntity> findByTeam(@Param("teamId") Long teamId); | |
| /** All policies in run order — used when team scoping is off (login-disabled). */ | |
| @Query("select p from PolicyEntity p order by coalesce(p.sortOrder, 0) asc, p.id asc") | |
| + " p.teamId = :teamId) order by p.sortOrder nulls first, p.id asc") | |
| List<PolicyEntity> findByTeam(@Param("teamId") Long teamId); | |
| /** All policies in run order — used when team scoping is off (login-disabled). */ | |
| @Query("select p from PolicyEntity p order by p.sortOrder nulls first, p.id asc") |
Details
✨ AI Reasoning
The code is trying to define stable run ordering for team policies and documents that policies with no sort value come first. However, the ordering expression converts null to 0 before sorting. That means records with null and records with sortOrder = 0 are treated identically and then ordered only by id, so null-valued rows are not guaranteed to come first. This creates a concrete mismatch between the stated behavior and actual query semantics.
Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
Remove unnecessary @repository annotations and corresponding unused imports from proprietary JPA repository interfaces. Files updated: ResourceGrantRepository, TeamLabelsRepository, ProcessedFileRepository, PolicyRepository, TeamMembershipRepository. No behavioral change — Spring Data auto-detects JpaRepository interfaces; this is a cleanup to remove static noise and unused imports.
Add blank lines between Spring Data imports and domain model imports in three repository classes to improve code organization and readability.
Apply consistent formatting to SaaS repository and configuration classes: - Reflow JavaDoc comment in SaasJpaConfig for line length - Add blank lines after import statements in repository interfaces (Google Java Format style)
Updates the bundled third-party license metadata to reflect newer dependency versions for Jackson JDK8 and Protobuf, and removes stale entries for renamed or obsolete modules after the dependency refresh.
✅ Backend License Check PassedAll backend dependencies have valid and allowed licenses. The backend license report has been updated successfully. |
🚀 V2 Auto-Deployment Complete!🔗 Direct Test URL (non-SSL) http://54.175.155.236:6930 🧩 Admin portal included - try it at http://54.175.155.236:6930/portal. This deployment will be automatically cleaned up when the PR is closed. 🔄 Auto-deployed for approved V2 contributors. |
Description of Changes
This PR removes redundant
@Repositoryannotations from Spring Data JPA repository interfaces and updates several core framework dependencies, primarily upgrading Spring Boot to 4.1.0.What was changed
@Repositoryannotations and related imports from all Spring Data JPA repository interfaces across theproprietaryandsaasmodules.@Repositoryinterfaces".org.apache.santuario:xmlsec:4.0.4com.google.guava:guava:${guavaVersion}getEnv()Gradle helper that logs relevant security and build environment variables during the build process.Why the change was made
JpaRepository, making explicit@Repositoryannotations unnecessary.Checklist
General
Documentation
Translations (if applicable)
scripts/counter_translation.pyUI Changes (if applicable)
Testing (if applicable)
task checkto verify linters, typechecks, and tests pass